import type { Rule } from 'ant-design-vue/lib/form'

const validatePhone = async (_rule: Rule, value: string) => {
  if (!value) {
    return Promise.reject('请输入手机号码')
  }
  return Promise.resolve()
}

export const formRule: Record<string, Rule[]> = {
  title: [
    {
      required: true,
      message: '请输入通知公告标题',
      trigger: 'blur'
    }
  ],
  targetIds: [
    {
      required: true,
      message: '请选择通知的接收人',
      trigger: 'blur'
    }
  ],
  content: [
    {
      required: true,
      message: '请输入通知公告内容',
      trigger: 'blur'
    }
  ],
  messageType: [
    {
      required: true,
      message: '请选择通知公告类型',
      trigger: 'blur'
    }
  ]
}
